Object.defineProperty(exports, "__esModule", { value: !0 }),
  (exports.toUrl = exports.navigateTo = void 0);
var t,
  e = (t = require("../libs/lodash")) && t.__esModule ? t : { default: t };
var n = function (t) {
    return new Promise(function (e, n) {
      wx.navigateTo({ url: t, success: e, fail: n });
    });
  },
  o = function (t) {
    return new Promise(function (e, n) {
      wx.redirectTo({ url: t, success: e, fail: n });
    });
  };
(exports.toUrl = function (t, n) {
  var o = t;
  return (
    n &&
      !e.default.isEmpty(n) &&
      (o = "".concat(t, "?").concat(
        e.default
          .map(n, function (t, e) {
            return "".concat(e, "=").concat(t);
          })
          .join("&"),
      )),
    "".concat(o)
  );
}),
  (exports.navigateTo = function (t, r) {
    var c = arguments.length > 2 && void 0 !== arguments[2] && arguments[2],
      a = arguments.length > 3 && void 0 !== arguments[3] && arguments[3],
      u = t,
      i = r;
    if (
      (e.default.isObject(i) &&
        (i = e.default
          .map(i, function (t, e) {
            return "".concat(e, "=").concat(t);
          })
          .join("&")),
      i &&
        (-1 === u.indexOf("?") ? (u += "?".concat(i)) : (u += "&".concat(i))),
      u)
    ) {
      var s = "".concat(u);
      return a ? wx.reLaunch({ url: s }) : c ? o(s) : n(s);
    }
    return "";
  });
